@extends('Api.common.title')
@section('content')
<div style="padding: 15px;">
    <fieldset class="layui-elem-field">
        <legend>系统设置 - 系统变量</legend>
        <div class="layui-field-box">
            <div class="layui-btn-group">
                <button class="layui-btn layui-btn-xs layui-btn-normal dw-dailog" dw-url="{{ URL::action('Api\SysConfigController@create')}}"
                        dw-title="新增系统变量">
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                <button class="layui-btn layui-btn-xs layui-btn-normal dw-dailog" dw-url="{{ URL::action('Api\SysConfigController@imgCreate')}}"
                        dw-title="新增系统变量">
                    <i class="layui-icon">&#xe654;</i>新增图片
                </button>
                <button class="layui-btn layui-btn-xs layui-btn-normal dw-dailog" dw-url="{{ URL::action('Api\SysConfigController@videoCreate')}}"
                        dw-title="新增系统变量">
                    <i class="layui-icon">&#xe654;</i>新增视频
                </button>
                <button class="layui-btn layui-btn-xs dw-refresh">
                    <i class="layui-icon">&#x1002;</i>刷新
                </button>
            </div>
            <hr>
            <!-- Table -->
            <table class="layui-table">
                <colgroup>
                    <col>
                    <col>
                    <col>
                    <col>
                </colgroup>
                <tbody>
                <tr>
                    <td style="width:25%" class="text-center">参数说明</td>
                    <td style="" class="text-center">参数值</td>
                    <td style="width:15%" class="text-center">变量名</td>
                    <td style="width:15%" class="text-center">操作</td>
                </tr>

                @foreach($list as $vo)
                <tr>
                    <td>{{$vo['info']}}</td>
                    <td>
                        @if($vo["type"] ==1 )
                            <div class="" style="margin-bottom: 0px;">
                                <textarea  name="value"  data-id="{{$vo['id']}}"  class="layui-textarea" >{{$vo['value']}}</textarea>
                                {{-- <input type="text" name="value" value="{{$vo['value']}}" class="layui-input" data-id="{{$vo['id']}}">--}}
                            </div>
                        @elseif($vo["type"] == 2)
                            <div class="" style="margin-bottom: 0px;">
                                <a href="{{$vo["file_list"]["uri"]}}" target="_blank" ><img src="{{$vo["file_list"]["uri"]}}" width="60px" height="60px"> </a>
                            </div>
                        @else
                            <div class="" style="margin-bottom: 0px;">
                                <video src="{{$vo["file_list"]["uri"]}}" controls="controls" height="200px">
                                    您的浏览器不支持 video 标签。
                                </video>
                            </div>
                        @endif
                    </td>
                    <td>{{$vo['varname']}}</td>
                    <td class="text-center">
                        <div class="layui-btn-group">

                            @if($vo["type"] == 2)
                                <button class="layui-btn layui-btn-xs layui-btn-normal dw-dailog"
                                        dw-url="imgCreate?id={{$vo['id']}}"
                                        dw-title="编辑"
                                >
                                    <i class="layui-icon">&#xe642;</i>编辑
                                </button>
                            @elseif($vo["type"] == 3)
                                <button class="layui-btn layui-btn-xs layui-btn-normal dw-dailog"
                                        dw-url="videoCreate?id={{$vo['id']}}"
                                        dw-title="编辑"
                                >
                                    <i class="layui-icon">&#xe642;</i>编辑
                                </button>
                            @endif

                            <button class="layui-btn layui-btn-xs layui-btn-danger dw-delete"
                                    dw-url="delete?id={{$vo['id']}}"
                                    dw-title="{{$vo['info']}}">
                                <i class="layui-icon">&#xe640;</i>删除
                            </button>
                        </div>
                    </td>
                </tr>
               @endforeach
                </tbody>
            </table>
            <!-- Table -->
            <blockquote class="layui-elem-quote">
             {{--   注意：调用方法 {literal}<code>{:field_global('变量名')}</code>{/literal}--}}
            </blockquote>
        </div>
    </fieldset>
</div>
<script type="text/javascript" src="/static/backend/javascript/sys_config.js"></script>
@endsection